package com.shundr.auth.user.http;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.shundr.auth.common.model.VersionInfo;
import com.shundr.auth.frame.util.JsonUtil;

/**
 * 用户资料
 * 
 * @author Administrator
 *
 */
public class CommonParser {
	/**
	 * @param data
	 * @return
	 * @throws JSONException
	 */
	public static String parserAppDownLoadUrl(String data) {
		try {
			JSONObject obj = new JSONObject(data);
			String info = obj.getString("appDownloadUrl");
			return info;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "";
	}

	/**
	 * @param data
	 * @return
	 * @throws JSONException
	 */
	public static VersionInfo parseVersionInfo(String data) {
		try {
			VersionInfo info = JsonUtil.fromJson(data, VersionInfo.class);
			return info;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
